package controller

import (
	"github.com/exam/service"
	"github.com/gin-gonic/gin"
	"net/http"
)

type OrderController struct {
	service service.IOrderService
}

func NewOrderController(service service.IOrderService) *OrderController {
	return &OrderController{service: service}
}

func (o *OrderController) OrderCount(c *gin.Context) {
	find, err := o.service.Find(c)
	if err != nil {
		return
	}
	c.JSON(http.StatusOK, gin.H{"code": 200, "msg": "成功", "data": find})
}
